{{Extend "layout"}}
{{Block "title"}}{{"测试采集规则"|T}}{{/Block}}
{{Block "breadcrumb"}}
{{Super}}
<li><a href="__BACKEND__/collector/rule">{{"采集规则"|T}}</a></li>
<li><a href="__BACKEND__/collector/rule_edit?id={{Stored.data.Id}}" data-toggle="tooltip" title="{{"点击编辑此规则"|T}}">{{Stored.data.Name}}</a></li>
<li class="active">{{"测试采集规则"|T}}</li>
{{/Block}}
{{Block "main"}}
<div class="row">
    <div class="col-md-12">

        <div class="block-transparent">
          <div class="header">
            <span class="pull-right">({{"为了快速获取测试结果，每一级页面只采集一条。下面，有请各级代表登场"|T}}) <i class="fa fa-smile-o"></i></span>
            <h4>{{"测试结果"|T}}</h4>
          </div>
          <ul class="timeline">
            {{$maxKey := Sub (len Stored.result) 1}}
            {{range $k,$v := Stored.result}}
            <li>
              {{if eq $k $maxKey}}
              <i class="fa fa-file green"></i>
              {{else if eq $k 0}}
              <i class="fa fa-globe purple"></i>
              {{else}}
              <i class="fa fa-list"></i>
              {{end}}
              {{$level := Add $k 1}}
              <span class="date">Level {{$level}}</span>
              <div class="content">
                <p>
                    <span class="pull-right">{{"耗时"|T}} {{$v.ElapsedString Lang}}</span>
                    <strong>{{T "第%d层页面" $level|ToHTML}}</strong>
                </p>
                <blockquote><a href="{{$v.URL}}" target="_blank">{{$v.URL}}</a> {{if $v.Title}}({{$v.Title}}){{end}}</blockquote>
                <pre>{{if and $v.IsSlice (gt (len $v.Result) 0)}}{{UnicodeDecode (JSONEncode (index $v.Result 0) " ")}}{{else}}{{UnicodeDecode (JSONEncode $v.Result " ")}}{{end}}</pre>
              </div>
            </li>
            {{end}}
          </ul>
        </div>


    </div>
</div>
{{/Block}}
{{Block "footer"}}
<script type="text/javascript">
</script>
{{/Block}}